package com.me.adapter.objectadapter;

/**
 * 对象适配器
 * 思路：不是继承src类，而是持有src的实例，解决兼容性的问题
 * 即：持有src类，实现dist类的接口，完成user->dist的适配
 */
public class Client {

    public static void main(String[] args) {
        System.out.println(" ==== 对象适配器模式 ====");
        Phone phone = new Phone();
		// 给手机进行充电
        VoltageAdapter voltageAdapter = new VoltageAdapter(new Voltage220V());
        phone.charging(voltageAdapter);
    }

}
